<script>
	import {
		getUserInfo
	} from "@/api/user.js"
	export default {

		onLaunch: function() {
			console.log('App Launch');
			const usertoken = uni.getStorageSync('usertoken');
			// @ts-ignore
			if (!usertoken) {
				// @ts-ignore
				// #ifdef APP-PLUS
				uni.reLaunch({
					url: '/pages/login/login'
				});
				// #endif
			} else {
				// @ts-ignore
				getUserInfo({
					userId: this.$store.state.userid
				}).then((res) => {
					// @ts-ignore
					this.$store.commit('setUserinfo', res.data);
				});
			}
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang='scss'>
	/*每个页面公共css */
	@import "uview-ui/index.scss";

	.flex-center-between {
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	view {
		box-sizing: border-box;
	}

	.flex-align-center {
		display: flex;
		align-items: center;
	}
</style>